<div id="event" data-event-id=<%= current_event.id %> class="hidden"></div>
<div id="event-lottery-prize" data-event-lottery-prize-id=<%= params[:event_lottery_prize_id] %> class="hidden"></div>

<div class="content-area">
  <img class="bg-img" src="/images/lottery_prize/background.png">
  <div class="prize-area col-md-8 col-md-offset-2">
    <div class="title-area col-xs-12">
      <div class="line-area">
        <div class="top-gradient"></div>
        <div class="bottom-gradient"></div>
      </div>
      <div class="col-xs-3 logo-area">
        <img src="/images/lottery_prize/logo.png" class="img-responsive">
      </div>
      <div class="col-xs-9">
        <h1>“<%= @event_lottery_prize.name %>”</h1>
      </div>
    </div>
    <div class="col-xs-4">
      <div class="lottery-area">
        <div class="lottery-bg"></div>
        <div class="lottery-title-area">
          <img class="head-bg" src="/images/lottery_prize/head-bg.png">
          <p class="lottery-title">获奖名单</p>
          <p class="lottery-num">获奖人数 <span id="lottery-prize-attendee-size"><%= @attendees.size %></span></p>
        </div>
        <div class="table-area">
          <table id="lottery-prize-attendees" class="lottery-person">
            <tr class="table-title">
              <th>序号</th>
              <td>&nbsp;</td>
              <th>获奖人</th>
              <th>奖项</th>
            </tr>
            <% @attendees.each do |attendee| %>
              <% lottery_prize = LotteryPrize.search_by_attendee_and_event_lottery_prize(attendee, @event_lottery_prize)%>
              <tr class="last-person">
                <td>
                  <div class="number-area"><%= attendee.id %></div>
                </td>
                <td>
                  <%= image_tag(attendee.avatar.url, class: 'name-icon attendee-avatar') %>
                </td>
                <td>
                  <%= attendee.name %>
                </td>
                <td>
                  <%= lottery_prize.first.event_lottery_prize_item.name %><i class="fa fa-times" aria-hidden="true"></i>
                </td>
              </tr>
            <% end %>
          </table>
        </div>
      </div>
    </div>
    <div class="col-xs-8 prize-content">
      <div class="col-xs-12 lottory-prize-area">
        <img class="lottery-item-bg" src="/images/lottery_prize/lottery-item-bg.png">
        <div class="col-xs-12 select-content">
          <div class="select-area" style="">
            <select id="lottery-prize-item">
              <% @event_lottery_prize_items.each do |lottery_prize_item| %>
                <option value=<%= lottery_prize_item.id %>><%= lottery_prize_item.name %></option>
              <% end %>
            </select>
          </div>
          <div class="person-no-area">
            <p>参与人数 <span><%= @total_attendee_count %></span></p>
          </div>
        </div>
        <div class="col-xs-12 person-area">
          <div class="person-msg">
            <div class="person-portrait">
              <img id="attendee-img" src="/images/lottery_prize/person.png">
            </div>
          </div>
          <div class="name-area">
            <p id="attendee-name">王佳</p>
            <p id="attendee-company">某某科技有限公司</p>
          </div>
          <div class="split-line">
            <div class="left-gradient"></div>
            <div class="right-gradient"></div>
          </div>
          <div class="start-button text-center">
            <button id="start-lottery-prize" type="button">开始抽奖</button>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<% content_for :style do %>
  <%= stylesheet_link_tag 'start_lottery_prize', media: 'all' %>
<% end %>

<% content_for :script do %>
<%= javascript_include_tag 'start_lottery_prize' %>
<% end %>
